{template header}
<style>
    .content{}
    .content img{max-width: 100%;}
</style>
<div class="container">


    <div class="bbox">
        <div class="bc onecate">
            <ul>
                <li><a href="{tsUrl('study')}">首页</a></li>
                {loop $arrOneCate $key $item}
                <li>
                    <a {if $item['cateid']==$strStudy['cateid']}class="select"{/if} href="{tsUrl('study','cate',array('id'=>$item['cateid']))}"> {$item['catename']}</a>
                </li>
                {/loop}
                <li class="create"><a href="{tsUrl('study','create')}">创建课程</a></li>
            </ul>
        </div>
    </div>

    <div class="twocate">
        <h1><a href="{tsUrl('study','cate',array('id'=>$oneCate['cateid']))}">{$oneCate['catename']}</a></h1>
        <ul class="channel-nav">
            {loop $arrTwoCate $key $item}
            <li><a href="{tsUrl('study','cate',array('id'=>$item['cateid']))}" >{$item[catename]}</a></li>
            {/loop}
        </ul>
    </div>


    <div class="row">
<div class="col-md-8">


<div class="panel panel-default">
<div class="panel-body">
<div class="kcinfo"> 
<div class="photo">
<a href="{tsUrl('study','show',array('id'=>$strStudy['studyid']))}"><img src="{$strStudy['photo']}" alt="{$strStudy['studyname']}" class="pic1 fl" /></a>
</div>


<div class="info">
<h1>
<a href="{tsUrl('study','show',array('id'=>$strStudy['studyid']))}">{$strStudy[studyname]}</a>          
</h1>

<div class="other">

<div class="price">价格：<i>￥{$strStudy['price']}</i></div>

课时：<span>{$strStudy['count_lesson']} 课</span>
<br />
学员：<span>{$strStudy['count_learn']} 人</span>
<br />
浏览：<span>{$strStudy['count_view']} 次</span>
</div>
</div>

<div class="learnbtn">

{if $strStudy['learn']}

{if $strStudy['learn']['status']==2}
已学完	
{/if}
{if $strStudy['learn']['status']==1}
已学{$strStudy['learn']['count_lesson']}课时
{/if}

{else}
<a class="btn btn-large btn-success" href="javascript:void('0');" onclick="studyLearn('{$strStudy['studyid']}');">购买学习</a>
{/if}
</div>

<div class="clear"></div>

<div style="margin-bottom:0px" class="pills">
<a class="on" href="{tsUrl('study','show',array('id'=>$strStudy[studyid]))}">课时</a>
{if $strStudy['userid']==$TS_USER['userid']  || $TS_USER['isadmin']==1}
<a href="{tsUrl('study','edit',array('ts'=>'base','studyid'=>$strStudy['studyid']))}">管理</a>
<a href="{tsUrl('study','edit',array('ts'=>'lessonadd','studyid'=>$strStudy[studyid]))}">添加新课时</a>
{/if}
</div>

</div>
</div>
</div>



    <div class="panel panel-default">
        <div class="panel-body">
<div class="lesson_show">
<h1><span class="lesson-index">L{$strLesson['orderid']}</span>
<span class="lesson-title">{$strLesson['title']}</span></h1>
<div class="content">
    {if $strStudy['learn']=='' && $strStudy['price']}

    <div class="alert alert-info">
        你需要购买课程后才可以学习！
    </div>

    {else}




    {if $strLesson['videoid']}
    <video src="{SITE_URL}uploadfile/study/video/{$strVideo['video']}" width="100%" controls="controls">您的浏览器不支持此种视频格式。</video>
    {/if}
    {$strLesson[content]}
    <div class="tar">
        {if $isLessonUser}
        已学完本课时
        {else}
        <a href="javascript:void('0');" onclick="lessonDo('{$strLesson['lessonid']}','$strStudy['studyid']');" class="btn btn-success" id="learn-btn" ><i class="icon-ok icon-white"></i> 我学完了</a>
        {/if}
    </div>



    {/if}


</div>



<div class="around-nav tar">
{if $upTopic}上一课时：<a  class="prev mrs" href="{tsUrl('study','topic',array('id'=>$upTopic['topicid']))}">{$upTopic['title']}</a>{/if}
{if $downTopic}下一课时：<a class="next" href="{tsUrl('study','topic',array('id'=>$downTopic['topicid']))}">{$downTopic['title']}</a>{/if}
</div> 
</div>  
</div>  
</div>




    <div class="panel panel-default">
        <div class="panel-heading">{$strLesson['count_comment']}个回应</div>
        <div class="panel-body">

{if $isLessonUser || $strLesson['userid'] == $TS_USER['userid']}
<form class="comment-form" method="post" action="{SITE_URL}index.php?app=study&ac=comment&ts=do" onSubmit="return submitonce(this)" id="formMini" enctype="multipart/form-data">

<textarea id="tseditor" name="content" class="content-field"></textarea>

<p class="tar" style="padding-top: 10px;">
<input type="hidden" name="lessonid" value="{$strLesson['lessonid']}" />
<button type="submit" class="btn btn-success">添加评论</button> 
</p>

</form>
{else}
<div class="tac">你未学过此课程，不允许评论！</div>
{/if}


{if $arrComment}

<ul class="comment">

{loop $arrComment $key $item}
<li class="clearfix" id="l_{$item[commentid]}">
<div class="user-face">
<a href="{tsUrl('user','duty',array('id'=>$item[user][userid]))}" rel="face"><img title="{$item[user][username]}" alt="{$item[user][username]}" src="{$item[user][face]}" width="48" /></a>
</div>
<div class="reply-doc">
<h4>{php echo date('Y-m-d H:i:s',$item[addtime])}
<a href="{tsUrl('user','duty',array('id'=>$item[user][userid]))}" rel="face" style="margin-left:5px; margin-right:5px;">{$item[user][username]}</a>
</h4>

<p>
{$item[content]}
</p>
<p class="reply-del">

</p>
</div>
<div class="clear"></div>
</li>
{/loop}

</ul>

<div class="page">{$pageUrl}</div>
{/if}
 
 
</div>
</div>

    <div class="panel panel-default">
        <div class="panel-heading">相关课程</div>
        <div class="panel-body lesson-nav">
            <div  class="row kecheng">
                {loop $arrRelatedStudy $key $item}
                <div class="col-md-4">


                    <div class="thumbnail">

                        <div class="photo"><a href="{tsUrl('study','show',array('id'=>$item['studyid']))}">
                            {if $item['photo']}
                            <img src="{php echo tsXimg($item['photo'],'study','255','140',$item['path'],'1')}" />
                            {else}
                            <img alt="{$item['studyname']}" src="{SITE_URL}app/study/skins/default/kecheng.gif">
                            {/if}
                        </a>
                        </div>
                        <p class="title"><a title="{item['studyname']}" href="{tsUrl('study','show',array('id'=>$item['studyid']))}">{$item['studyname']}</a></p>
                        <p>
                            <span>学员：{$item['count_learn']}</span>
                            <span>课时：{$item['count_lesson']}</span>
                            <span><a title="{$item['user']['username']}" href="{tsUrl('user','topic',array('id'=>$item['user']['userid']))}">{$item['user']['username']}</a></span>
                        </p>


                    </div>


                </div>
                {/loop}
            </div>

</div>
</div>
</div>


<div class="col-md-4">

    <div class="panel panel-default">
        <div class="panel-heading">课时列表</div>
        <div class="panel-body lesson-nav">
<ul>
{loop $arrLesson $key $item}
<li 
{if $strLesson['lessonid']==$item['lessonid']}class=" current"{/if}><span class="lesson-index">L{$item['orderid']}</span>
<span class="lesson-title"><a href="{tsUrl('study','lesson',array('id'=>$item['lessonid']))}">{php echo cututf8($item['title'],0,16,false)}</a></span>
</li>                                      
{/loop}
</ul>
        </div>
</div>



    <div class="panel panel-default">
        <div class="panel-heading">最近学完的人 <span class="right"><a href="{tsUrl('study','lessonuser',array('lessonid'=>$strLesson['lessonid']))}">全部</a></span></div>
        <div class="panel-body lesson-nav">



{if $arrLessonUser}
            <div class="row">
                {loop $arrLessonUser $key $item}
                <div class="col-md-3 tac">
                    <a href="{tsUrl('user','topic',array('id'=>$item[userid]))}" ><img class="img-circle" src="{$item[face]}" alt="{$item[username]}" width="48" height="48" /></a>
                    <div class="username pd100"><a href="{tsUrl('user','topic',array('id'=>$item[userid]))}"  title="{$item[username]}">{$item[username]}</a></div>
                </div>
                {/loop}
            </div>
{else}
<p class="c9">还没有人学完此课程!</p>
{/if}

</div>
</div>


</div>



</div>
</div>
{php doAction('tseditor','mt')}

<script type="text/javascript">
    var swf = $("#lesson-media-player").data("media").swf_url;
    var mp4 = $("#lesson-media-player").data("media").mp4_url;

    var html = '<embed allowfullscreen="true" src="'+swf+' "width="100%" height="400"></embed> ';

    if(swf){
        $("#lesson-media-player").html(html);
    }

</script>
{template footer}